<?php

class Application_Form_Blog extends Zend_Form {

    public function init() {
        $this->setAction('/admin/blog/create')
                ->setMethod('post')
                ->setAttrib('id', 'blogForm')
                ->setDecorators(ZendBlog_Decorator_Decorator::Form());

        /* Title */
        $this->addElement('text', 'title', array(
            'decorators' => ZendBlog_Decorator_Decorator::Element(),
            'label' => 'Title',
            'validators' => array(
              array('stringLength', false, array(3, 100))
            ),
            'attribs' => array(
                'maxlength' => 100,
                'size' => 40
            ),
            'required' => true
        ));

        /* Create button */
        $this->addElement('submit', 'Create', array(
            'decorators' => ZendBlog_Decorator_Decorator::Submit()
        ));
    }
}

